apiready =function(){
seajs.use(['../../V',"../../api","../../jquery","../../app","../../service","../../pop"],function(V,$api,$,$app,service,$pop){
	var vm = {
		el: '.container',
	  	data: {
	    	wayIndex: -1,
	    	account_name: '',    //--真实姓名
	    	account_number: '',  //--账户
	    	bank: '',
	    	money: 0            //--可提现金额
	  	},
	  	methods:{
	  		//--提交提现
	  		submitWithdraw: function(){
	  			var unionid = $api.getStorage("shop_unionid"), self = this;
	  			this.account_name = this.$refs.accountName.value || '';
	  			this.account_number = this.$refs.accountNumber.value.replace(/\s+/g,"") || '';
	  			this.bank = this.$refs.accountBank.value.replace(/\s+/g,"") || '';
	  			this.money = api.pageParam.money;
	  			if(this.account_name == ''){
	  				$app.toast("请输入姓名！");
	  				return;
	  			}
	  			if(this.account_number == ''){
	  				$app.toast('请输入卡号');
	  				return;
	  			}
	  			if(!/^[0-9]{11,24}$/g.test(this.account_number)){
	  				$app.toast('请输入合法的卡号！');
	  				return;
	  			}
	  			if(this.bank == '' || this.bank.length > 18){
	  				$app.toast('请输入正确银行！');
	  				return;
	  			}
	  			$app.ajax(service.buyWithdrawApply,{
					data: {
						values: {
							unionid: unionid,
							type: 3,
							account: self.account_number,
							realname: self.account_name,
							bank: self.bank
						}
					}
				},function (res) {
					console.log("buy_withdraw_apply： "+JSON.stringify(res));
					if(res.code == 0){
						$app.toast("提现申请成功！");
						api.sendEvent({
							name:'withdraw_',
						});
						$api.setTimeout(function(){
							api.closeToWin({
								name: api.pageParam.name || api.pageParam.prve
							});
						},300);
					}
				});
	  		},
	  		bankCardNumber: function(){

	  		}
	  	},
	  	mounted:function() {
	  		var self = this;
  			function btnKeyBack(){
	  			api.sendEvent({
					name:'withdrawBank_'
				});
				$api.setTimeout(function(){
					api.closeWin();
				},300);
			}
			//--点击上面按钮返回
			$api.addEvt($api.dom('#btn-back-new'), 'click', function() {
	            btnKeyBack();
	        });

			//--返回键
			api.addEventListener({
				name: 'keyback'
			},function(ret, err){
				btnKeyBack();
			});

			//--右滑
	        api.addEventListener({
			    name:'swiperight'
			},function(ret,err){
			    btnKeyBack();
         	});
	  	},
	  	created: function(){

	  	}
	};
	//var shopVue = new Vue(vm);
	var even = function() {}
	var newVue = new Vue(vm);
	even();
});
}
